#!/usr/bin/env bash

# In repo bib-push-gitee, run 'git remote add upstream git@gitee.com:ganxh/bib.git'
# Clear contents in $HOME/.df/log/update-repo-bib.log
# 清除 $HOME/.df/log/update-repo-bib.log 文件中的内容。
if [ ! -d $HOME/.df/log/ ]; then
    mkdir $HOME/.df/log
    touch $HOME/.df/log/update-repo-bib.log
else truncate -s 0 $HOME/.df/log/update-repo-bib.log
fi

cd $HOME/Documents/repo-research/bib
rm -f .git/index.lock
git push

cd $HOME/Documents/repo-research/bib-push-gitee
git pull
git push upstream
